package com.dd.dc.base.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 描述:
 *
 * @author: yanglin
 * @Date: 2021-03-15-11:17
 * @Version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="基础对象", description="基础对象")
public class DBaseEntity  implements Serializable {

    @ApiModelProperty(value = "删除标记（0-未删除；1-已删除）")
    @TableField("DEL_FLG")
    public Integer delFlg;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATE_BY")
    public String createBy;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    @TableField("CREATE_TIME")
    public LocalDateTime createTime;

    @ApiModelProperty(value = "更新人")
    @TableField("UPDATE_BY")
    public String updateBy;

    @ApiModelProperty(value = "最后更新时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    @TableField("LAST_UPDATE_TIME")
    public LocalDateTime lastUpdateTime;
}
